ACTOR Defiler : RGAMonster
{
	//$Category monsters
	Health 1800
	Radius 31
	Height 56
	Mass 500
	Speed 13
	PainChance 15
	Monster 
	+NOGRAVITY
    +FLOAT 
	+DROPOFF
	+MISSILEMORE
	SeeSound "Defiler/Sight"
	PainSound "baron/pain"
	DeathSound "Defiler/Death"
	ActiveSound "baron/active"
	Obituary "%o was hunted down by a Defiler."
  DropItem "SoulSphere2"
	States
	{
	Spawn:
		DEFI A 0
		DEFI A 0 Thing_SetSpecial(0,226,613,0,random(250,450))
		POSS A 0 A_GiveInventory("XPAmount", random(250, 450))
		POSS P 0 ACS_ExecuteAlways(651,0,0,0,0)
		DEFI AB 10 A_Look
		goto Spawn+4
	See:
		DEFI AABBCC 2 A_VileChase
		Loop
	Missile:
		DEFI D 0 BRIGHT A_Jump(65, 5)
		DEFI D 8 BRIGHT A_FaceTarget 
		DEFI E 8 BRIGHT	A_FaceTarget
		DEFI F 8 BRIGHT	A_CustomMissile("DefilerShot", 15, 0, 0)
		Goto See
		DEFI D 8 BRIGHT A_FaceTarget 
		DEFI E 8 BRIGHT	A_FaceTarget
		DEFI F 0 BRIGHT A_PlaySound("Defiler/Attack")
		DEFI F 0 BRIGHT A_CustomMissile("DefilerBall", 15, 0, -45)
		DEFI F 0 BRIGHT A_CustomMissile("DefilerBall", 15, 0, 0)
		DEFI F 8 BRIGHT A_CustomMissile("DefilerBall", 15, 0, 45)
		Goto See
	Heal:
		DEFI N 10 BRIGHT A_SpawnItem("DefilerFire", 55)
		DEFI OP 10 BRIGHT
		Goto See
	Pain:
		DEFI G 5   
		DEFI G 5 A_Pain
		Goto See
	Death:
		DEFI H 7
		DEFI I 7 A_Scream
		DEFI J 7 A_NoBlocking
		DEFI J 0 ACS_ExecuteAlways(648,0,0,0,0)
		DEFI KL 7
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 0)
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 45)
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 90)
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 135)
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 180)
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 225)
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 270)
		DEFI M 0 A_PlaySound("Defiler/Attack")
		DEFI M 0 A_CustomMissile("DefilerBall", 20, 0, 315)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 0)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 45)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 90)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 135)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 180)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 225)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 270)
		DEFI M 0 A_CustomMissile("DefilerShot", 20, 0, 315)
		DEFI M 7
		Stop
	}
}

ACTOR DefilerFire
{
	+NOBLOCKMAP 
	+NOGRAVITY
	RenderStyle Add
	Alpha 1
	States
	{
	Spawn:
		REFR A 2 BRIGHT  A_StartFire
		REFR BAB 2 BRIGHT  A_Fire
		REFR C 2 BRIGHT  A_FireCrackle
		REFR BCBCDCDCDEDED 2 BRIGHT  A_Fire
		REFR E 2 BRIGHT  A_FireCrackle
		REFR FEFEFGHGHGH 2 BRIGHT  A_Fire
		Stop
	}
}

ACTOR DefilerBall
{
    Radius 8
    Height 6
    Scale 0.5
    Speed 8
    Damage 2
	DeathSound "imp/shotx"
    +SEEKERMISSILE
    PROJECTILE
    Renderstyle ADD
	Decal DoomImpScorch
    States
    {
    Spawn:
        RVBA AB 2 Bright A_SeekerMissile (10,20)
        Loop
    Death:
        RVBA CDEFGH 4 Bright
        Stop
    }
}

ACTOR DefilerShot 
{
	Scale 1.5
    Radius 12
    Height 16
    Speed 16
    Damage 10
    PROJECTILE
	RENDERSTYLE ADD
	ALPHA 0.9
    SeeSound "imp/attack"
    DeathSound "imp/shotx"
	Decal DoomImpScorch
    States
    {
    Spawn:
        DFSH AB 5 Bright
        Loop
    Death:
        DFSH CDE 5 Bright
        Stop
    }
}